package com.tojabo.sortObject;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class ObjectSort {

	
	public static void main(String[] args) {
		
		List<Person> list = new ArrayList<Person>();
		list.add(new Person("jack","man",21));
		list.add(new Person("green","man",45));
		list.add(new Person("mary","feman",8));
		list.add(new Person("tina","feman",34));
		list.add(new Person("hawen","man",37));
		list.add(new Person("shala","feman",21));
		
		//Collections.sort(list,ComparatorFactory.getComparator("person"));
		
		SortUtil.sort(list, ComparatorFactory.getComparator("person"));
		
		for(Person p:list){
			System.out.println(p.toString());
		}
	}

}
